package com.yingdong.logic.controller;

import com.yingdong.excel.Item;
import com.yingdong.logic.appconst.ItemConst;
import com.yingdong.logic.domain.GameUser;
import com.yingdong.logic.service.ItemService;

public class ItemController extends GameController {

	public ItemController(GameUser user) {
		super(user);

	}

	@Override
	public void init() {

	}

	@Override
	public void firstEnter() {

	}

	@Override
	public void saveDB() {

	}

	public void addItem(int itemId, int count) {
		Item item = ItemService.getItemById(itemId);
		if (item != null) {
			switch (item.getType()) {
			case ItemConst.TYPE_RESOURCE:
				user.getResourceController().addResource(itemId, count);;
				break;
			case ItemConst.TYPE_BAGITEM:

				break;
			case ItemConst.TYPE_HOUSEITEM:

				break;
			case ItemConst.TYPE_MOTION:

				break;
			case ItemConst.TYPE_PET:

				break;
			case ItemConst.TYPE_SKILL:

				break;
			default:
				break;
			}
		}
	}

}
